package dao.college;

import java.util.List;

import util.paramvo.SearchParamVO;
import vo.CollegeVO;

import com.ibatis.sqlmap.client.SqlMapClient;

public class CollegeDAOImpl implements CollegeDAO{

	private SqlMapClient sqlMapClient;

	public void setSqlMapClient(SqlMapClient sqlMapClient) {
		this.sqlMapClient = sqlMapClient;
	}

	@Override
	public List<CollegeVO> getSearchedCollegeByWord(SearchParamVO search) throws Exception {
		return sqlMapClient.queryForList("college.getSearchedCollegeByWord", search);
	}

	@Override
	public int countSearchedCollegeByWord(List<String> search) throws Exception {
		return (Integer) sqlMapClient.queryForObject("college.countSearchedCollegeByWord", search);
	}

	@Override
	public void registerCollege(String college_name) throws Exception {
		sqlMapClient.insert("college.registerCollege", college_name);
	}

	@Override
	public void updateCollege(CollegeVO param) throws Exception {
		sqlMapClient.update("college.updateCollege", param);
	}

	@Override
	public void deleteCollege(int college_no) throws Exception {
		sqlMapClient.update("college.deleteCollege", college_no);
	}
}
